package com.ruoyi.training.service.impl;

import java.util.List;

import com.ruoyi.training.domain.CertificateReissue;
import com.ruoyi.training.mapper.CertificateReissueMapper;
import com.ruoyi.training.service.ICertificateReissueService;
import com.ruoyi.training.util.xuehua.SnowflakeIdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 换证管理Service业务层处理
 * 
 * @author hcc
 * @date 2025-11-06
 */
@Service
public class CertificateReissueServiceImpl implements ICertificateReissueService
{
    @Autowired
    private CertificateReissueMapper certificateReissueMapper;

    /**
     * 查询换证管理
     * 
     * @param certificateReissueId 换证管理主键
     * @return 换证管理
     */
    @Override
    public CertificateReissue selectCertificateReissueByCertificateReissueId(String certificateReissueId)
    {
        return certificateReissueMapper.selectCertificateReissueByCertificateReissueId(certificateReissueId);
    }

    /**
     * 查询换证管理列表
     * 
     * @param certificateReissue 换证管理
     * @return 换证管理
     */
    @Override
    public List<CertificateReissue> selectCertificateReissueList(CertificateReissue certificateReissue)
    {
        return certificateReissueMapper.selectCertificateReissueList(certificateReissue);
    }

    /**
     * 新增换证管理
     * 
     * @param certificateReissue 换证管理
     * @return 结果
     */
    @Override
    public int insertCertificateReissue(CertificateReissue certificateReissue)
    {
        certificateReissue.setCertificateReissueId(String.valueOf(new SnowflakeIdUtils(5,8).nextId()));
        return certificateReissueMapper.insertCertificateReissue(certificateReissue);
    }

    /**
     * 修改换证管理
     * 
     * @param certificateReissue 换证管理
     * @return 结果
     */
    @Override
    public int updateCertificateReissue(CertificateReissue certificateReissue)
    {
        return certificateReissueMapper.updateCertificateReissue(certificateReissue);
    }

    /**
     * 批量删除换证管理
     * 
     * @param certificateReissueIds 需要删除的换证管理主键
     * @return 结果
     */
    @Override
    public int deleteCertificateReissueByCertificateReissueIds(String[] certificateReissueIds)
    {
        return certificateReissueMapper.deleteCertificateReissueByCertificateReissueIds(certificateReissueIds);
    }

    /**
     * 删除换证管理信息
     * 
     * @param certificateReissueId 换证管理主键
     * @return 结果
     */
    @Override
    public int deleteCertificateReissueByCertificateReissueId(String certificateReissueId)
    {
        return certificateReissueMapper.deleteCertificateReissueByCertificateReissueId(certificateReissueId);
    }
}
